package edu.sctu.practice.class01.zhangwang.assigns.assign01;

/**
 * Created by Z_W on 2015/10/8.
 */
public class Rational {
    public double a;
    public double b;
    public double divide;

    public Rational(double a,double b){
        this.a = a;
        this.b = b;
    }

    public double getAdd(){
            return a+b;
    }

    public double getReduce(){
        return a-b;
    }

    public double getMultiply(){
        return a*b;
    }

    public double getDivide(){
        if (b!=0){
            divide = a/b;
        }else{
            System.out.println("被除数不能为0！");
        }
        return divide;
    }
}
